home *** CD-ROM | disk | FTP | other *** search
-
- /*******************************************************************************
- ********************************************************************************
- ********************************************************************************
-
- PERMISSION TO COPY THIS SOFTWARE IS HEREBY GIVEN BY THE AUTHOR PROVIDED THAT
- THIS LEADING MESSAGE IS INCLUDED IN ALL OF THE RELEVANT SOURCE FILES.
-
- P. SCHMITZ, UNIVERSITY OF KEELE, MAY 1988.
-
-
- ********************************************************************************
- ********************************************************************************
- *******************************************************************************/
-
- #include "header.h"
-
- dock(cp)
- register struct player *cp;
- {
- int dockingok;
-
- dockingok=OFF;
- i=cp->xpos;
- j=cp->ypos;
- if ((inuniv(i,j)=='*') && ((cp->xvel==0) && (cp->yvel==0)))
- dockingok=ON;
- if (dockingok==OFF)
- {
- plot1(cp," Your'e not beside a federation starbase Captain. ");
- plot2(cp," ");
- } else
- {
- if ((cp->cloakingdevice)||(cp->shields))
- {
- if (cp->shields)
- {
- plot1(cp," ");
- plot2(cp," While you have your shields are up? Youre kidding! ");
- }
- else
- {
- plot1(cp," ");
- plot2(cp," While you are cloaked? -come off it! ");
- }
- } else
- {
- plot1(cp," Docking procedure completed. ");
- plot2(cp," Weapons and Crystal Units recharged Captain. ");
- plotstatus(cp,7);
-
- if (cp->maxenergy>=STARTENERGY)
- cp->energy=cp->maxenergy;
- else
- {
- cp->energy=STARTENERGY;
- cp->maxenergy=STARTENERGY;
- }
- cp->phaserbanks=cp->maxphaser;
- cp->photontorpedos=cp->maxphoton;
- plotenergy(cp);
- plotmaxenergy(cp);
- plotphaserbanks(cp);
- plotphotontorpedos(cp);
- }
- }
- }
-
- undock(cp)
- register struct player *cp;
- {
- if ((cp->stat==7) && (cp->xvel==0) && (cp->yvel==0))
- {
- plot1(cp," Un-docking successful Captain. No casualties this time. ");
- plot2(cp," Your'e improving... ");
- plotstatus(cp,3);
- } else
- {
- plot1(cp,"Tell me :- How can you un-dock when your'e not docked??? ");
- plot2(cp," ");
- }
- }
-
-
-